package com.lz.football.module.guide.view
{
	import com.common.utils.DisplayObjectUtil;
	import com.common.utils.Reflection;
	import com.global.GlobalDef;
	import com.greensock.TweenLite;
	import com.liangzhong.events.AppEventDispatcher;
	import com.liangzhong.events.GuideEvent;
	import com.lz.football.module.guide.Guide;
	import com.lz.football.module.main.view.RightPanel;
	import com.lz.football.module.main.view.TopPanel;
	
	import flash.display.InteractiveObject;
	import flash.display.MovieClip;
	import flash.geom.Point;
	
	import lz.controls.managers.AnimationManager;
	/**
	 *好友 
	 * @author lake
	 * 
	 */	
	public class FriendGuideView extends Guide
	{
		public function FriendGuideView()
		{
			super();
		}
		/**
		 *初始化 
		 */		
		override protected function initView():void
		{
			super.initView();
			//提交引导
			AppEventDispatcher.getInstance().dispatchEvent(new GuideEvent(GuideEvent.POST_GUIDE,{step:18}));
			getFuncIcon();
		}
		/**
		 *获得按钮
		 */		
		private function getFuncIcon():void
		{
			GlobalDef.GameWindowContainer.addChild(bgMark);
			sceneBtn = Reflection.createInstance("com.football.main.friendMc");
			(sceneBtn as InteractiveObject).mouseEnabled = false;
			RightPanel.friendMc.visible = false;
			var entP :Point = RightPanel.friendMc.localToGlobal(new Point(-22,-22));
			
			var appearMc :MovieClip = Reflection.createInstance("com.football.guide.AppearAtSkin");
			DisplayObjectUtil.removeAllChildren(appearMc.mc.mc);
			appearMc.mc.mc.addChild(sceneBtn);
			(sceneBtn as InteractiveObject).mouseEnabled = false;
			addDispToStage(appearMc);
			AnimationManager.moveToThing(new Point(appearMc.x,appearMc.y),appearMc,entP,{delay:1,overwrite:0},.5);
			TweenLite.delayedCall(1.5,showFuncIcon);
		}
		/**
		 *显示按钮 
		 * 
		 */		
		private function showFuncIcon():void
		{
			RightPanel.friendMc.visible = true;
			RightPanel.resizeBtnPos();
			clear();
		}
		/**
		 *执行 
		 * 
		 */		
		override public function process():void
		{
			initView();
		}
		/**
		 *清理 
		 * 
		 */		
		override public function clear():void
		{
			super.clear();
		}
	}
}